/*
 * XML Type:  XCommand
 * Namespace: http://www.seedwill.com/xul/core
 * Java type: com.seedwill.xul.core.XCommand
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.core.impl;
/**
 * An XML XCommand(@http://www.seedwill.com/xul/core).
 *
 * This is a complex type.
 */
public class XCommandImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.core.XCommand
{
    private static final long serialVersionUID = 1L;
    
    public XCommandImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName CONFIG$0 = 
        new javax.xml.namespace.QName("", "config");
    private static final javax.xml.namespace.QName SORT$2 = 
        new javax.xml.namespace.QName("", "sort");
    
    
    /**
     * Gets the "config" element
     */
    public com.seedwill.xul.core.XActionViewConfig getConfig()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XActionViewConfig target = null;
            target = (com.seedwill.xul.core.XActionViewConfig)get_store().find_element_user(CONFIG$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "config" element
     */
    public void setConfig(com.seedwill.xul.core.XActionViewConfig config)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XActionViewConfig target = null;
            target = (com.seedwill.xul.core.XActionViewConfig)get_store().find_element_user(CONFIG$0, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XActionViewConfig)get_store().add_element_user(CONFIG$0);
            }
            target.set(config);
        }
    }
    
    /**
     * Appends and returns a new empty "config" element
     */
    public com.seedwill.xul.core.XActionViewConfig addNewConfig()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XActionViewConfig target = null;
            target = (com.seedwill.xul.core.XActionViewConfig)get_store().add_element_user(CONFIG$0);
            return target;
        }
    }
    
    /**
     * Gets the "sort" attribute
     */
    public int getSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SORT$2);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "sort" attribute
     */
    public org.apache.xmlbeans.XmlInt xgetSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(SORT$2);
            return target;
        }
    }
    
    /**
     * True if has "sort" attribute
     */
    public boolean isSetSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(SORT$2) != null;
        }
    }
    
    /**
     * Sets the "sort" attribute
     */
    public void setSort(int sort)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SORT$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(SORT$2);
            }
            target.setIntValue(sort);
        }
    }
    
    /**
     * Sets (as xml) the "sort" attribute
     */
    public void xsetSort(org.apache.xmlbeans.XmlInt sort)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(SORT$2);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(SORT$2);
            }
            target.set(sort);
        }
    }
    
    /**
     * Unsets the "sort" attribute
     */
    public void unsetSort()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(SORT$2);
        }
    }
}
